package hrms.service;

import hrms.dao.StaffMapper;
import hrms.entity.Staff;
import hrms.entity.Statistic;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StaffService {
    @Autowired
    private StaffMapper staffMapper;

    public Staff findById(Integer id){
        return staffMapper.findById(id);
    }

    public void insertStaff(Staff staff){ staffMapper.insertStaff(staff); }

    public Staff findStaffById(int id){ return staffMapper.findStaffById(id); }

    public List<Staff> findStaffByDepartment_id(int department_id){return staffMapper.findStaffByDepartment_id(department_id); }

    public Staff findStaffByName(String name) {
        return staffMapper.findStaffByName(name);
    }

    public List<Staff> selectAllStaff(){
        return staffMapper.selectAllStaff();
    }

    public List<Statistic> statisticsGender(){return staffMapper.statisticsGender();}

    public List<Statistic> statisticsPost(){return staffMapper.statisticsPost();}

    public List<Statistic> statisticsEducation(){return staffMapper.statisticsEducation();}
}
